using System.Diagnostics;
using System.Runtime.CompilerServices;

#if UNITY_5_3_OR_NEWER
    using UnityProfiler = UnityEngine.Profiling.Profiler;
#endif

namespace Pinwheel.Toolkits
{
    public static class Profiler
    {
        [Conditional("ENABLE_PROFILER")]
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static void Start(string name)
        {
#if UNITY_5_3_OR_NEWER            
            UnityProfiler.Start(name);
#endif                
        }
        
        [Conditional("ENABLE_PROFILER")]
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static void End()
        {
#if UNITY_5_3_OR_NEWER            
            UnityProfiler.End();
#endif                
        }
    }
}